/***
 * 是否下一环节设置事件
 */
function setAssignerNextState(assignerCheckDom,requestName) {
    if($(assignerCheckDom).is(":checked")){
        //alert($("#workflowReview.nextUserSelectDiv").show());
        document.getElementById(requestName+".nextUserSelectDiv").style.display="";
    }else{
        document.getElementById(requestName+".nextUserSelectDiv").style.display="none";
    }
}
/***
 * 打开下一环节处理人选择页面
 */
function openAssignerSelectUserPage(){
    /***
     * 选择处理人
     */
    WindowManager.openLayer({
        type: 2,
        title: '选择下一环节处理人',
        area: ['80%', '80%'],        content: ROOT_PATH + '/permission/user/simpleList.shtml',
        callBack:function(data){//窗口关闭后的回调函数
            // 得到动态指定选择的人员
            var userData=data[0];
            $("#nextActivityUserId").textbox('setValue',userData.name);
            $("#nextActivityUserId").textbox('setText',userData.realName);
            //$("input[name='workflowReview.nextUser']").val(userData.realName);
        }
    });
}
/***
 * 根据业务id查询流程信息
 * @param row
 */
function flowMonitorByBusinessId(businessId) {
    WindowManager.openLayer({
        type: 2,
        title: '业务流程监控',
        area: ['800px', '450px'],
        content: ROOT_PATH + '/workflow/flowManagement/flowMonitorByBusinessId.shtml?businessId='+businessId
    });
}
/***
 * 根据工作项id查询流程信息
 * @param workItemId  工作项id
 */
function flowMonitorByWorkItemId(workItemId) {
    WindowManager.openLayer({
        type: 2,
        title: '业务流程监控',
        area: ['800px', '450px'],
        content: ROOT_PATH + '/workflow/flowManagement/flowMonitorByWorkItemId.shtml?workItemId='+workItemId
    });
}
/***
 * 验证审批结果、审批意见、下一环节审批人的填写
 */
function checkVerifyResult(reviewRequestName){
    var result=$("input[name='"+reviewRequestName+".result']").is(":checked");
    if(!result){
        layer.alert("请选择处理结果!");
        return false;
    }
    var comments=$("textarea[name='"+reviewRequestName+".comments']").val();
    if(comments==null||comments==''){
        layer.alert("请填写处理意见!");
        return false;
    }
    var isDynamicAssigner=$("input[name='"+reviewRequestName+".isDynamicAssigner']").is(":checked");
    if(isDynamicAssigner){
        var nextUserId=$("input[name='"+reviewRequestName+".nextUserId']").val();
        if(nextUserId==null||nextUserId==''){
            layer.alert("请选择下一环节处理人!");
            return false;
        }
    }
    return true;
}